/* 
 * 机构管理模块
 */

// 保存
export function save() {
  return {
    url: 'dept/save',
    type: 'post',
    data: {
      "code": 200,
      "msg": null,
      "data": 1
    }
  }
}
// 批量删除
export function batchDelete() {
  return {
    url: 'dept/delete',
    type: 'post',
    data: {
      "code": 200,
      "msg": null,
      "data": 1
    }
  }
}
export function findDeptTree(params) {
  // 查询机构树
  let findTreeData = {
    "code": 200,
    "msg": null,
    "data": [
      //1级
      {
        "id": 1,
        "createBy": "admin",
        "createTime": "2018-09-23T11:35:55.000+0000",
        "lastUpdateBy": null,
        "lastUpdateTime": null,
        "name": "xx集团",
        "parentId": null,
        "orderNum": 1,
        "delFlag": 0,
        "children": [
          //2级
          {
            "id": 2,
            "createBy": "admin",
            "createTime": "2018-09-23T11:37:03.000+0000",
            "lastUpdateBy": null,
            "lastUpdateTime": null,
            "name": "广州分公司",
            "parentId": 2,
            "orderNum": 0,
            "delFlag": 0,
            "children": [
              {
                "id": 4,
                "createBy": "admin",
                "createTime": "2018-09-23T11:38:10.000+0000",
                "lastUpdateBy": null,
                "lastUpdateTime": null,
                "name": "技术部",
                "parentId": 2,
                "orderNum": 0,
                "delFlag": 0,
                "children": [],
                "parentName": "技术部",
                "level": 2
              },
              {
                "id": 5,
                "createBy": "admin",
                "createTime": "2018-09-23T11:38:10.000+0000",
                "lastUpdateBy": null,
                "lastUpdateTime": null,
                "name": "美术部",
                "parentId": 2,
                "orderNum": 0,
                "delFlag": 0,
                "children": [],
                "parentName": "美术部",
                "level": 2
              },
              {
                "id": 6,
                "createBy": "admin",
                "createTime": "2018-09-23T11:38:10.000+0000",
                "lastUpdateBy": null,
                "lastUpdateTime": null,
                "name": "策划部",
                "parentId": 2,
                "orderNum": 0,
                "delFlag": 0,
                "children": [],
                "parentName": "策划部",
                "level": 2
              },
              {
                "id": 7,
                "createBy": "admin",
                "createTime": "2018-09-23T11:38:10.000+0000",
                "lastUpdateBy": null,
                "lastUpdateTime": null,
                "name": "测试部",
                "parentId": 2,
                "orderNum": 0,
                "delFlag": 0,
                "children": [],
                "parentName": "测试部",
                "level": 2
              },
              {
                "id": 8,
                "createBy": "admin",
                "createTime": "2018-09-23T11:38:10.000+0000",
                "lastUpdateBy": null,
                "lastUpdateTime": null,
                "name": "运营部",
                "parentId": 2,
                "orderNum": 0,
                "delFlag": 0,
                "children": [],
                "parentName": "运营部",
                "level": 2
              },
              {
                "id": 9,
                "createBy": "admin",
                "createTime": "2018-09-23T11:38:10.000+0000",
                "lastUpdateBy": null,
                "lastUpdateTime": null,
                "name": "客服部",
                "parentId": 2,
                "orderNum": 0,
                "delFlag": 0,
                "children": [],
                "parentName": "客服部",
                "level": 2
              },
              {
                "id": 10,
                "createBy": "admin",
                "createTime": "2018-09-23T11:38:10.000+0000",
                "lastUpdateBy": null,
                "lastUpdateTime": null,
                "name": "行政部",
                "parentId": 2,
                "orderNum": 0,
                "delFlag": 0,
                "children": [],
                "parentName": "行政部",
                "level": 2
              },
              {
                "id": 11,
                "createBy": "admin",
                "createTime": "2018-09-23T11:38:10.000+0000",
                "lastUpdateBy": null,
                "lastUpdateTime": null,
                "name": "法务部",
                "parentId": 2,
                "orderNum": 0,
                "delFlag": 0,
                "children": [],
                "parentName": "法务部",
                "level": 2
              }
            ],
            "parentName": "广州分公司",
            "level": 1
          },
          //2级
          {
            "id": 3,
            "createBy": "admin",
            "createTime": "2018-09-23T11:37:28.000+0000",
            "lastUpdateBy": null,
            "lastUpdateTime": null,
            "name": "深圳分公司",
            "parentId": 2,
            "orderNum": 1,
            "delFlag": 0,
            "children": [
              {
                "id": 12,
                "createBy": "admin",
                "createTime": "2018-09-23T11:38:10.000+0000",
                "lastUpdateBy": null,
                "lastUpdateTime": null,
                "name": "技术部",
                "parentId": 2,
                "orderNum": 0,
                "delFlag": 0,
                "children": [],
                "parentName": "技术部",
                "level": 2
              },
              {
                "id": 13,
                "createBy": "admin",
                "createTime": "2018-09-23T11:38:10.000+0000",
                "lastUpdateBy": null,
                "lastUpdateTime": null,
                "name": "美术部",
                "parentId": 2,
                "orderNum": 0,
                "delFlag": 0,
                "children": [],
                "parentName": "美术部",
                "level": 2
              },
              {
                "id": 14,
                "createBy": "admin",
                "createTime": "2018-09-23T11:38:10.000+0000",
                "lastUpdateBy": null,
                "lastUpdateTime": null,
                "name": "策划部",
                "parentId": 2,
                "orderNum": 0,
                "delFlag": 0,
                "children": [],
                "parentName": "策划部",
                "level": 2
              },
              {
                "id": 15,
                "createBy": "admin",
                "createTime": "2018-09-23T11:38:10.000+0000",
                "lastUpdateBy": null,
                "lastUpdateTime": null,
                "name": "测试部",
                "parentId": 2,
                "orderNum": 0,
                "delFlag": 0,
                "children": [],
                "parentName": "测试部",
                "level": 2
              },
              {
                "id": 16,
                "createBy": "admin",
                "createTime": "2018-09-23T11:38:10.000+0000",
                "lastUpdateBy": null,
                "lastUpdateTime": null,
                "name": "运营部",
                "parentId": 2,
                "orderNum": 0,
                "delFlag": 0,
                "children": [],
                "parentName": "运营部",
                "level": 2
              },
              {
                "id": 17,
                "createBy": "admin",
                "createTime": "2018-09-23T11:38:10.000+0000",
                "lastUpdateBy": null,
                "lastUpdateTime": null,
                "name": "客服部",
                "parentId": 2,
                "orderNum": 0,
                "delFlag": 0,
                "children": [],
                "parentName": "客服部",
                "level": 2
              },{
                "id": 18,
                "createBy": "admin",
                "createTime": "2018-09-23T11:38:10.000+0000",
                "lastUpdateBy": null,
                "lastUpdateTime": null,
                "name": "行政部",
                "parentId": 2,
                "orderNum": 0,
                "delFlag": 0,
                "children": [],
                "parentName": "行政部",
                "level": 2
              },
              {
                "id": 19,
                "createBy": "admin",
                "createTime": "2018-09-23T11:38:10.000+0000",
                "lastUpdateBy": null,
                "lastUpdateTime": null,
                "name": "法务部",
                "parentId": 2,
                "orderNum": 0,
                "delFlag": 0,
                "children": [],
                "parentName": "法务部",
                "level": 2
              }
            ],
            "parentName": "深圳分公司",
            "level": 1
          }
        ],
        "parentName": null,
        "level": 0
      }
      
    ]
  }
  return {
    url: 'dept/findTree',
    type: 'get',
    data: findTreeData
  }
}
